/**
 * 统一提示函数
 * @param {string} title 提示内容
 * @param {object} options 配置项
 * @param {string} options.icon 图标类型 'none' | 'success' | 'error' | 'loading'
 * @param {number} options.duration 显示时长
 * @param {boolean} options.mask 是否显示遮罩
 */
export const showToast = (title, options = {}) => {
  const defaultOptions = {
    icon: 'none',
    duration: 2000,
    mask: false
  }
  
  uni.showToast({
    title,
    ...defaultOptions,
    ...options
  })
}

// 成功提示
export const showSuccess = (title, options = {}) => {
  showToast(title, { ...options, icon: 'success' })
}

// 错误提示
export const showError = (title, options = {}) => {
  showToast(title, { ...options, icon: 'error' })
}

// 加载提示
export const showLoading = (title = '加载中...', options = {}) => {
  uni.showLoading({
    title,
    mask: true,
    ...options
  })
}

// 隐藏加载提示
export const hideLoading = () => {
  uni.hideLoading()
} 